package com.clock.domain.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Pattern;
import java.util.Date;

@EqualsAndHashCode(callSuper = false)
@AllArgsConstructor
@NoArgsConstructor
@Data
@ApiModel("用户")
public class User {

    @ApiModelProperty(value = "用户id")
    private Long userId;

    @ApiModelProperty(value = "用户名")
/*    @Pattern(regexp = "/^[\\u4e00-\\u9fa5a-zA-Z0-9]{3,12}$/")*/
    private String userName;

    @ApiModelProperty(value = "用户密码")
/*    @Pattern(regexp = "/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9a-zA-Z]{6,16}$/")*/
    private String userPassword;

    @ApiModelProperty(value = "用户电话")
    private String userTel;

    @ApiModelProperty(value = "用户邮箱")
    private String userEmail;

    @ApiModelProperty(value = "总学习时间")
    private Long userStudyAllTime;

    @ApiModelProperty(value = "用户创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date userCreateTime;

    @ApiModelProperty(value = "用户角色id")
    private Integer userRoleId;

}
